//
//  PContentCell.swift
//  CJPack
//
//  Created by 陈警卫 on 2023-06-01.
//

import UIKit
import Foundation

class PContentCell: UICollectionViewCell {
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setupView()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    var index: Int? {
        didSet {
            if let index = index {
                // 预加载
                kCJLog(index)
            }
        }
    }
    
    var current: Int? {
        didSet {
            if let current = current, current != oldValue {
                // 当前
                kCJLog(current)
            }
        }
    }
    
    
    var vc = PDetailController()
    
    func setupView() {
        contentView.addSubview(vc.view)
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        vc.view.frame = self.bounds
    }
    
}
